package com.shenyong.ladmin.controller;

import com.shenyong.ladmin.entity.Level;
import com.shenyong.ladmin.logConfig.Log;
import com.shenyong.ladmin.logConfig.OperationType;
import com.shenyong.ladmin.result.Page;
import com.shenyong.ladmin.service.adLevelService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author
 * @site
 * @company
 * @create
 */
@RestController
@RequestMapping("/adLevel")
public class AdLevelController {
    @Autowired
    private adLevelService levelService;
    @RequiresAuthentication
    @RequestMapping("/getLevelPage")
    public Map<String, Object> getLevelPage(Page page){
        return  levelService.getLevelPage(page);
    }
    @RequiresAuthentication
    @Log(describe = "修改等级信息",operationType= OperationType.UPDATE)
    @RequestMapping("/LevelUpdate")
    public int LevelUpdate(Level level){
        return  levelService.LevelUpdate(level);
    }
}
